//
//  MyAttentionCell.m
//  birthdayCalculate
//
//  Created by 宋浩文的pro on 15/12/14.
//  Copyright © 2015年 宋浩文的pro. All rights reserved.
//

#import "MyAttentionCell.h"
#import "UIImageView+WebCache.h"
#import <BmobSDK/Bmob.h>

@interface MyAttentionCell ()

@property (weak, nonatomic) IBOutlet UIImageView *pictureImage;
@property (weak, nonatomic) IBOutlet UILabel *sourceLabel;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;


@end

@implementation MyAttentionCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cell_readOne = @"MyAttentionCell";
    MyAttentionCell *cell = [tableView dequeueReusableCellWithIdentifier:cell_readOne];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"MyAttentionCell" owner:nil options:nil] lastObject];
        cell.backgroundColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.5];
        
    }
    return cell;
    
    
}

- (void)setModel:(FavorateModel *)model
{
    _model = model;
    
    [self.pictureImage sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"shw_zhanwei"]];
    self.pictureImage.contentMode = UIViewContentModeScaleAspectFill;
    self.pictureImage.layer.masksToBounds = YES;
    
    self.sourceLabel.text = model.source;
    self.sourceLabel.font = [UIFont systemFontOfSize:14];
    self.sourceLabel.textColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.8];
    
    self.titleLabel.text = model.title;
    
}

@end
